package com.gitee.wsl.ext.any

inline fun <reified T> T.sameAs(
    method: (condition: T) -> T
): T? = if (this == method(this)) {
    this
} else {
    null
}

inline fun <reified T> T.notSameAs(
    method: (condition: T) -> T
): T? = if (this != method(this)) {
    this
} else {
    null
}

inline fun <reified T> T.sameAs(
    method:  T
): T? = if (this == method) {
    this
} else {
    null
}

inline fun <reified T> T.notSameAs(
    method:  T
): T? = if (this != method) {
    this
} else {
    null
}